package com.zhongke.cotrun.service.impl;

import com.zhongke.cotrun.mapper.FacilitatorMapper;
import com.zhongke.cotrun.mapper.UserInfoMapper;
import com.zhongke.cotrun.model.exception.MyException;
import com.zhongke.cotrun.model.pojo.Facilitator;
import com.zhongke.cotrun.model.pojo.UserInfo;
import com.zhongke.cotrun.model.resultpackage.CodeMsg;
import com.zhongke.cotrun.service.FacilitatorService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;
import java.beans.Transient;

@Service
public class FacilitatorServiceImpl implements FacilitatorService {
    @Autowired
    UserInfoMapper userInfoMapper;
    @Autowired
    FacilitatorMapper facilitatorMapper;


    /**
     * 新建服务商信息
     *
     * @param facilitator
     * @return
     */
    @Override
    @Transient
    public Boolean insertFacilitator(Facilitator facilitator) throws MyException {


        return facilitatorMapper.insertFacilitator(facilitator);
    }
    /**
     * 修改服务商认证信息
     */

    public Boolean updateFacilitator(Facilitator facilitator){
        return facilitatorMapper.updateFacilitator(facilitator);
    }
    /**
     *根据用户id号查询服务商认证信息
     */


    public  Facilitator selectFacilitatorByUserId(Integer userId){
        return facilitatorMapper.selectFacilitatorByLinkId(userId);
    }
}
